home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / serien / purity / nr.18 / uniprint / uniprintv1.3.p < prev   
Text File  |  1995-04-22  |  52KB  |  1,688 lines

  1.  
  2. program UniPrint;
  3.  
  4. {------------------------------------------------------------------------}
  5. { *** UniPrint V1.3 ***
  6.  
  7.   © in 8/1993 by Jan Stötzer; This tool is FREEWARE as long nothing is
  8.   changed and the files »UniPrint«,»UniPrint.dok« and »UniPrint.prf«
  9.   are copied and distributed together.
  10.  
  11.   Have fun.......
  12.  
  13.   For Bug-Reports, hints, ideas, legal swapping ... write to:
  14.  
  15.             Jan Stötzer
  16.             An der Hasel 195
  17.       98527 Suhl                                                         }
  18. {------------------------------------------------------------------------}
  19.  
  20. Uses Intuition,Graphics;
  21.  
  22. {$incl "libraries/dosextens.h"}
  23.  
  24. type xytyp    = array[1..12] of integer;
  25.      ImgPlane = array[1..8] of word;
  26.      PrefsTyp = record
  27.                   Version : string[5];
  28.                   Colors  : array[0..3,0..2] of cardinal;
  29.                   Qual    : cardinal;
  30.                   NewForm : cardinal;
  31.                   Request : cardinal;
  32.                 end;
  33.  
  34. var Scr : ^Screen;
  35.     Vp  : ViewPort;
  36.     Win : ^Window;
  37.     OWin: ^Window;
  38.     WWin: ^Window;
  39.     WCon: ptr;
  40.     Rast: ^RastPort;
  41.     Prc : ^Process;
  42.     PrcH: Ptr;
  43.     Txt : array[0..22] of IntuiText; Static;
  44.     Bor : array[1..22] of Border; Static;
  45.     xy  : array[1..20] of xytyp;
  46.     Img : array[1..2] of Image; Static;
  47.     Dat : array[1..2] of ^ImgPlane; Static;
  48.     Inf : array[1..15] of StringInfo; Static;
  49.     Gad : array[0..24] of Gadget; Static;
  50.     Msg : ^IntuiMessage;
  51.  
  52.     UpPr: PrefsTyp;
  53.     f   : file of PrefsTyp;
  54.     PDat: PrefsTyp;
  55.     Buf : array[1..15] of string[60]; Static;
  56.     UBuf: array[1..15] of string[60]; Static;
  57.     MCl : long;
  58.     MCod: word;
  59.     MAdr: ^Gadget;
  60.  
  61.     i   : integer;
  62.     ex  : boolean;
  63.     cnt : integer;
  64.     cnt2: integer;
  65.     x   : char;
  66.     ok  : boolean;
  67.  
  68.     FirstCall : boolean;         {Help-Var 4 Printer-Rout}
  69.  
  70.     NotFirstCall : boolean;      {Help-Var 4 Prefs-Rout}
  71.  
  72. {------------------------------------------------------------------------}
  73.  
  74.   procedure CreateBoolXYData(b,h:integer;var xy1,xy2:xytyp);
  75.  
  76.   begin
  77.     xy1:=xytyp(-2,-2,-2,h+2,b+2,h+2,b+1,h+1,-1,h+1,-1,-1);
  78.     xy2:=xytyp(-1,-2,b+2,-2,b+2,h+1,b+1,h,b+1,-1,0,-1);
  79.   end;
  80.  
  81. {------------------------------------------------------------------------}
  82.  
  83.   procedure CreateStringXYData(b,h:integer;var xy1,xy2:xyTyp);
  84.  
  85.   begin
  86.     xy1:=xyTyp(-4,-4,-4,h+2,b+4,h+2,b+3,h+1,-3,h+1,-3,-3);
  87.     xy2:=xyTyp(-3,-4,b+4,-4,b+4,h+1,b+3,h,b+3,-3,-2,-3);
  88.   end;
  89.  
  90. {------------------------------------------------------------------------}
  91.  
  92.   function Sure:boolean;
  93.  
  94.   var SWin : ^Window;
  95.       SRast: ^RastPort;
  96.       SMsg : ^IntuiMessage;
  97.       STxt : array[1..3] of IntuiText;
  98.       Sxy  : array[1..4] of xyTyp;
  99.       SBor : array[1..4] of Border;
  100.       SGad : array[1..2] of Gadget;
  101.       AGad : ^Gadget;
  102.  
  103.       ex   : boolean;
  104.  
  105.   begin
  106.     SWin:=Open_Window(15,199,615,46,1,GADGETUP+RAWKEY,BORDERLESS+ACTIVATE,Nil,
  107.                      Scr,600,46,600,46);
  108.     SRast:=SWin^.RPort;
  109.  
  110.     CreateBoolXYData(600,35,Sxy[1],Sxy[2]);
  111.     SBor[1]:=Border(0,0,1,0,0,6,^Sxy[1],^SBor[2]);
  112.     SBor[2]:=Border(0,0,2,0,0,6,^Sxy[2],Nil);
  113.     DrawBorder(SRast,^SBor[1],5,2);
  114.  
  115.     STxt[1]:=IntuiText(1,0,0,0,0,Nil,"Bist Du Dir da sicher ???",Nil);
  116.     PrintIText(SRast,^STxt[1],29,16);
  117.  
  118.     CreateBoolXYData(150,22,Sxy[3],Sxy[4]);
  119.     SBor[3]:=Border(0,0,1,0,0,6,^Sxy[3],^SBor[4]);
  120.     SBor[4]:=Border(0,0,2,0,0,6,^Sxy[4],Nil);
  121.     STxt[2]:=IntuiText(1,0,0,67,7,Nil,"Ja",Nil);
  122.     STxt[3]:=IntuiText(1,0,0,63,7,Nil,"Nee",Nil);
  123.  
  124.     for i:=1 to 2 do
  125.       SGad[i]:=Gadget(Nil,270+(i-1)*170,9,150,22,GADGHCOMP,RELVERIFY,
  126.                       BOOLGADGET,^SBor[3],Nil,^STxt[i+1],0,Nil,i,0);
  127.     SGad[1].NextGadget:=^SGad[2];
  128.  
  129.     SetAPen(SRast,1);
  130.     Move(SRast,336,25);
  131.     Draw(SRast,344,25);
  132.     Move(SRast,501,25);
  133.     Draw(SRast,509,25);
  134.  
  135.     SWin^.FirstGadget:=^SGad[1];
  136.     RefreshGadgets(SWin^.FirstGadget,SWin,Nil);
  137.  
  138.     repeat
  139.       ex:=false;
  140.       SMsg:=Wait_Port(SWin^.UserPort);
  141.       SMsg:=Get_Msg(SWin^.UserPort);
  142.       case SMsg^.Class of
  143.         GADGETUP : begin
  144.                      ex:=true;
  145.                      AGad:=SMsg^.IAddress;
  146.                      case AGad^.GadgetID of
  147.                        1 : Sure:=true;
  148.                        2 : Sure:=false;
  149.                        otherwise
  150.                      end;
  151.                    end;
  152.         RAWKEY   : case SMsg^.Code of
  153.                      $26,$43,$44 : begin
  154.                                      ex:=true;
  155.                                      Sure:=true;
  156.                                    end;
  157.                      $36,$45     : begin
  158.                                      ex:=true;
  159.                                      Sure:=false;
  160.                                    end;
  161.                      otherwise
  162.                    end;
  163.         otherwise
  164.       end;
  165.       Reply_Msg(SMsg);
  166.     until ex;
  167.     Close_Window(SWin);
  168.   end;
  169.  
  170. {------------------------------------------------------------------------}
  171.  
  172.   procedure StatusText(s:str);
  173.  
  174.   begin
  175.     PrintIText(Rast,^Txt[21],120,203);
  176.     if s="" then
  177.       s:="Nix los hier...";
  178.     Txt[20]:=IntuiText(1,0,1,0,0,Nil,s,Nil);
  179.     PrintIText(Rast,^Txt[20],120,203);
  180.   end;
  181.  
  182. {------------------------------------------------------------------------}
  183.  
  184.   procedure FlipDruck;
  185.  
  186.   type DText = array[1..9] of str;
  187.  
  188.   var DruckText : DText;
  189.       hs        : string;
  190.  
  191.   begin
  192.     DruckText:=DText("Paketzettel",
  193.                      "Adresslabel klein",
  194.                      "Adresslabel mittel",
  195.                      "Adresslabel groß",
  196.                      "Absenderlabel klein",
  197.                      "Absenderlabel mittel",
  198.                      "Absenderlabel groß",
  199.                      "Postkarte",
  200.                      "Postkarte doppelt");
  201.     if cnt<9 then
  202.       inc(cnt)
  203.     else
  204.       cnt:=1;
  205.     hs:="Druckform »"+DruckText[cnt]+"« angewählt";
  206.     StatusText(^hs);
  207.     Buf[14]:=DruckText[cnt];
  208.     Gad[18].NextGadget:=Nil;
  209.     RefreshGadgets(^Gad[18],Win,Nil);
  210.     Gad[18].NextGadget:=^Gad[19]
  211.   end;
  212.  
  213. {------------------------------------------------------------------------}
  214.  
  215.   procedure FlipForm;
  216.  
  217.   type FText = array[1..20] of str;
  218.  
  219.   var FormText : FText;
  220.  
  221.   begin
  222.     FormText:=FText("Warensendung",
  223.                     "Büchersendung",
  224.                     "Blindensendung",
  225.                     "Eilsendung",
  226.                     "Luftpost",
  227.                     "Per Einschreiben",
  228.                     "Eigenhändig",
  229.                     "Nachnahme",
  230.                     "Brief",
  231.                     "Päckchen",
  232.                     "Paket",
  233.                     " ···",
  234.                     "Cécogramme",
  235.                     "Lettre",
  236.                     "À remettre en main propre",
  237.                     "Exprès",
  238.                     "Recommandé",
  239.                     "Par avion",
  240.                     "Remboursement",
  241.                     " ···");
  242.    if cnt2<20 then
  243.      inc(cnt2)
  244.    else
  245.      cnt2:=1;
  246.    Buf[15]:=FormText[cnt2];
  247.    Gad[19].NextGadget:=Nil;
  248.    RefreshGadgets(^Gad[19],Win,Nil);
  249.    Gad[19].NextGadget:=^Gad[20]
  250.  end;
  251.  
  252. {------------------------------------------------------------------------}
  253.  
  254.   procedure SetColors;
  255.  
  256.   begin
  257.     for i:=0 to 3 do
  258.       SetRGB4(^Vp,i,PDat.Colors[i,0],PDat.Colors[i,1],PDat.Colors[i,2]);
  259.   end;
  260.  
  261. {------------------------------------------------------------------------}
  262.  
  263.   procedure Init;
  264.  
  265.   begin
  266.  
  267.     Scr:=Open_Screen(0,0,640,256,2,0,1,HIRES+GENLOCK_VIDEO,Nil);
  268.     if Scr=Nil then
  269.       Error("Konnte Screen nicht öffnen");
  270.  
  271.     Vp:=Scr^.ViewPort;
  272.     PDat:=UpPr;
  273.     SetColors;
  274.  
  275.     Win:=Open_Window(0,0,640,256,1,RAWKEY+GADGETUP,BORDERLESS+ACTIVATE+
  276.                      RMBTRAP,Nil,Scr,640,256,640,256);
  277.     if Win=Nil then
  278.       Error("Konnte Window nicht öffnen");
  279.  
  280.     Rast:=Win^.RPort;
  281.  
  282.     PrcH:=FindTask(Nil);
  283.     Prc:=PrcH;
  284.     OWin:=Prc^.pr_WindowPtr;
  285.     Prc^.pr_WindowPtr:=Win;
  286.  
  287.     CreateBoolXYData(620,240,xy[1],xy[2]);
  288.     Bor[1]:=Border(0,0,1,0,0,6,^xy[1],^Bor[2]);
  289.     Bor[2]:=Border(0,0,2,0,0,6,^xy[2],Nil);
  290.     DrawBorder(Rast,^Bor[1],10,5);
  291.  
  292.     CreateBoolXYData(600,180,xy[3],xy[4]);
  293.     Bor[3]:=Border(0,0,1,0,0,6,^xy[3],^Bor[4]);
  294.     Bor[4]:=Border(0,0,2,0,0,6,^xy[4],Nil);
  295.     DrawBorder(Rast,^Bor[3],20,12);
  296.  
  297.     CreateBoolXYData(508,10,xy[17],xy[18]);
  298.     Bor[19]:=Border(0,0,1,0,0,6,^xy[17],^Bor[20]);
  299.     Bor[20]:=Border(0,0,2,0,0,6,^xy[18],Nil);
  300.     DrawBorder(Rast,^Bor[19],112,201);
  301.  
  302.     CreateBoolXYData(100,20,xy[5],xy[6]);
  303.     Bor[5]:=Border(0,0,1,0,0,6,^xy[5],^Bor[6]);
  304.     Bor[6]:=Border(0,0,2,0,0,6,^xy[6],Nil);
  305.     Bor[7]:=Bor[5];
  306.     Bor[8]:=Bor[6];
  307.     Bor[7].FrontPen:=2;
  308.     Bor[8].FrontPen:=1;
  309.     Bor[7].NextBorder:=^Bor[8];
  310.     Txt[0]:=IntuiText(1,0,0,22,6,Nil,"Drucken",Nil);
  311.     Txt[1]:=IntuiText(1,0,0,34,6,Nil,"Info",Nil);
  312.     Txt[2]:=IntuiText(1,0,0,38,6,Nil,"Neu",Nil);
  313.     Txt[3]:=IntuiText(1,0,0,30,6,Nil,"Prefs",Nil);
  314.     Txt[4]:=IntuiText(1,0,0,22,6,Nil,"Beenden",Nil);
  315.  
  316.  
  317.     for i:=0 to 4 do
  318.       Gad[i]:=Gadget(^Gad[i+1],21+i*125,220,100,20,GADGHCOMP,RELVERIFY,BOOLGADGET,
  319.                      ^Bor[5],^Bor[7],^Txt[i],0,Nil,i,0);
  320.  
  321.     CreateBoolXYData(80,10,xy[7],xy[8]);
  322.     Bor[9]:=Border(0,0,1,0,0,6,^xy[7],^Bor[10]);
  323.     Bor[10]:=Border(0,0,2,0,0,6,^xy[8],Nil);
  324.     for i:=0 to 4 do begin
  325.       DrawBorder(Rast,^Bor[9],40,30+i*16);
  326.       DrawBorder(Rast,^Bor[9],341,110+i*16);
  327.     end;
  328.     DrawBorder(Rast,^Bor[9],20,201);
  329.  
  330.     CreateStringXYData(156,8,xy[9],xy[10]);
  331.     CreateStringXYData(56,8,xy[17],xy[18]);
  332.     Bor[11]:=Border(0,0,1,0,0,6,^xy[9],^Bor[12]);
  333.     Bor[12]:=Border(0,0,2,0,0,6,^xy[10],Nil);
  334.     Bor[19]:=Border(0,0,1,0,0,6,^xy[17],^Bor[20]);
  335.     Bor[20]:=Border(0,0,2,0,0,6,^xy[18],Nil);
  336.     Txt[5]:=IntuiText(1,0,0,-80,0,Nil,"Name 1:",Nil);
  337.     Txt[6]:=IntuiText(1,0,0,-80,0,Nil,"Name 2:",Nil);
  338.     Txt[7]:=IntuiText(1,0,0,-80,0,Nil,"Straße:",Nil);
  339.     Txt[8]:=IntuiText(1,0,0,-80,0,Nil,"PLZ/Ort:",Nil);
  340.     Txt[9]:=IntuiText(1,0,0,-80,0,Nil,"Telefon:",Nil);
  341.     Txt[10]:=IntuiText(1,0,0,-80,0,Nil,"Ort:",Nil);
  342.     Txt[11]:=IntuiText(1,0,0,-80,0,Nil,"PLZ:",Nil);
  343.  
  344.     for i:=1 to 15 do begin
  345.       Buf[i]:="";
  346.       UBuf[i]:="";
  347.       Inf[i]:=StringInfo(^Buf[i],^UBuf[i],0,31,0,0,0,0,0,0,Nil,0,Nil);
  348.     end;
  349.     Inf[5].MaxChars:=25;
  350.     Inf[10].MaxChars:=9;
  351.     Inf[15].MaxChars:=30;
  352.     for i:=11 to 13 do
  353.       Inf[i].MaxChars:=36;
  354.  
  355.     for i:=5 to 9 do
  356.       Gad[i]:=Gadget(^Gad[i+1],132,32+(i-5)*16,160,10,GADGHCOMP,RELVERIFY,STRGADGET,
  357.                        ^Bor[11],Nil,^Txt[i],0,^Inf[i-4],i,0);
  358.  
  359.     for i:=10 to 14 do
  360.       Gad[i]:=Gadget(^Gad[i+1],433,112+(i-10)*16,160,10,GADGHCOMP,RELVERIFY,STRGADGET,
  361.                        ^Bor[11],Nil,^Txt[i-5],0,^Inf[i-4],i,0);
  362.     Gad[13].GadgetText:=^Txt[10];
  363.     Gad[14].GadgetText:=^Txt[11];
  364.     Gad[14].Width:=60;
  365.     Gad[14].GadgetRender:=^Bor[19];
  366.  
  367.     CreateStringXYData(246,8,xy[11],xy[12]);
  368.     Bor[13]:=Border(0,0,1,0,0,6,^xy[11],^Bor[14]);
  369.     Bor[14]:=Border(0,0,2,0,0,6,^xy[12],Nil);
  370.  
  371.     for i:=15 to 17 do
  372.       Gad[i]:=Gadget(^Gad[i+1],42,128+(i-15)*16,240,10,GADGHCOMP,RELVERIFY,STRGADGET,
  373.                      ^Bor[13],Nil,Nil,0,^Inf[i-4],i,0);
  374.  
  375.     CreateStringXYData(216,8,xy[13],xy[14]);
  376.     Bor[15]:=Border(0,0,1,0,0,6,^xy[13],^Bor[16]);
  377.     Bor[16]:=Border(0,0,2,0,0,6,^xy[14],Nil);
  378.     Txt[12]:=IntuiText(3,0,0,-26,-16,Nil,"Drucken als:",Nil);
  379.     Txt[13]:=IntuiText(3,0,0,-26,-16,Nil,"Besondere Versandform:",Nil);
  380.  
  381.     for i:=18 to 19 do
  382.       Gad[i]:=Gadget(^Gad[i+1],373,48+(i-18)*32,220,10,GADGHCOMP,RELVERIFY,STRGADGET,
  383.                      ^Bor[15],Nil,^Txt[i-6],0,^Inf[i-4],i,0);
  384.  
  385.     CreateBoolXYData(20,10,xy[15],xy[16]);
  386.     Bor[17]:=Border(0,0,1,0,0,6,^xy[15],^Bor[18]);
  387.     Bor[18]:=Border(0,0,2,0,0,6,^xy[16],Nil);
  388.  
  389.     Dat[1]:=Ptr(Alloc_Mem(SizeOf(ImgPlane),2));
  390.     Dat[1]^:=ImgPlane(%0000111110000000,
  391.                       %0011110111100000,
  392.                       %0111000000110000,
  393.                       %1110000000011000,
  394.                       %1100000000011000,
  395.                       %1100000011111111,
  396.                       %1100000001111110,
  397.                       %1100000000011000);
  398.     Img[1]:=Image(2,1,16,8,1,Dat[1],1,0,Nil);
  399.  
  400.     for i:=20 to 21 do begin
  401.       Gad[i]:=Gadget(^Gad[i+1],341,46+(i-20)*32,20,10,GADGHNONE+GADGIMAGE,RELVERIFY,
  402.                      BOOLGADGET,^Img[1],Nil,Nil,0,Nil,i,0);
  403.       DrawBorder(Rast,^Bor[17],341,46+(i-20)*32);
  404.     end;
  405.  
  406.     CreateBoolXYData(30,11,xy[19],xy[20]);
  407.     Bor[21]:=Border(0,0,1,0,0,6,^xy[19],^Bor[22]);
  408.     Bor[22]:=Border(0,0,2,0,0,6,^xy[20],Nil);
  409.     Txt[22]:=IntuiText(1,0,0,3,2,Nil,"CLI",Nil);
  410.     Gad[22]:=Gadget(Nil,580,18,30,11,GADGHCOMP,RELVERIFY,
  411.                     BOOLGADGET,^Bor[21],Nil,^Txt[22],0,Nil,22,0);
  412.  
  413.     Txt[14]:=IntuiText(3,0,0,44,16,Nil,"Absender:",^Txt[15]);
  414.     Txt[15]:=IntuiText(3,0,0,44,112,Nil,"Kurze Info für Empfänger:",^Txt[16]);
  415.     Txt[16]:=IntuiText(1,0,0,45,176,Nil,"UniPrint V1.3 © by Dreamer 1993",^Txt[17]);
  416.     Txt[17]:=IntuiText(2,0,0,44,177,Nil,"UniPrint V1.3 © by Dreamer 1993",^Txt[18]);
  417.     Txt[18]:=IntuiText(3,0,0,345,96,Nil,"Empfänger:",^Txt[19]);
  418.     Txt[19]:=IntuiText(1,0,0,30,203,Nil,"Status:",Nil);
  419.     PrintIText(Rast,^Txt[14],0,0);
  420.  
  421.     SetAPen(Rast,1);
  422.     Move(Rast,41,235);
  423.     Draw(Rast,49,235);
  424.     Move(Rast,179,235);
  425.     Draw(Rast,187,235);
  426.     Move(Rast,307,235);
  427.     Draw(Rast,315,235);
  428.     Move(Rast,424,235);
  429.     Draw(Rast,432,235);
  430.     Move(Rast,541,235);
  431.     Draw(Rast,549,235);
  432.     Move(Rast,583,28);
  433.     Draw(Rast,590,28);
  434.  
  435.     SetAPen(Rast,3);
  436.     Move(Rast,410,40);
  437.     Draw(Rast,419,40);
  438.     Move(Rast,425,72);
  439.     Draw(Rast,434,72);
  440.     Move(Rast,43,120);
  441.     Draw(Rast,52,120);
  442.     Move(Rast,60,24);
  443.     Draw(Rast,67,24);
  444.     Move(Rast,344,104);
  445.     Draw(Rast,353,104);
  446.  
  447.     cnt:=0;
  448.     FlipDruck;
  449.  
  450.     cnt2:=19;
  451.     FlipForm;
  452.  
  453.     FirstCall:=true;
  454.  
  455.     Win^.FirstGadget:=^Gad[0];
  456.     RefreshGadgets(Win^.FirstGadget,Win,Nil);
  457.  
  458.     Txt[21]:=IntuiText(1,0,1,0,0,Nil,"                                                            ",Nil);
  459.     StatusText("Willkommen zu UniPrint V1.3 - © 1993 by Dreamer of Neoplasia");
  460.  
  461.   end;
  462.  
  463. {------------------------------------------------------------------------}
  464.  
  465.   procedure Neu;
  466.  
  467.   begin
  468.     if UpPr.NewForm in [1,3,5,6,8] then begin
  469.       for i:=1 to 4 do begin
  470.         Buf[i]:="";
  471.         UBuf[i]:="";
  472.       end;
  473.       Gad[9].NextGadget:=Nil;
  474.       RefreshGadgets(^Gad[5],Win,Nil);
  475.       Gad[9].NextGadget:=^Gad[10];
  476.     end;
  477.     if UpPr.NewForm in [1,2,4,6,8] then begin
  478.       for i:=5 to 10 do begin
  479.         Buf[i]:="";
  480.         UBuf[i]:="";
  481.       end;
  482.       Gad[14].NextGadget:=Nil;
  483.       RefreshGadgets(^Gad[10],Win,Nil);
  484.       Gad[14].NextGadget:=^Gad[15];
  485.     end;
  486.     if UpPr.NewForm in [1,4,5,7,8] then begin
  487.       for i:=11 to 13 do begin
  488.         Buf[i]:="";
  489.         UBuf[i]:="";
  490.       end;
  491.       Gad[17].NextGadget:=Nil;
  492.       RefreshGadgets(^Gad[15],Win,Nil);
  493.       Gad[17].NextGadget:=^Gad[18];
  494.     end;
  495.     if UpPr.NewForm=1 then begin
  496.       cnt:=0;
  497.       FlipDruck;
  498.       cnt2:=19;
  499.       FlipForm;
  500.     end;
  501.     StatusText("");
  502.   end;
  503.  
  504. {------------------------------------------------------------------------}
  505.  
  506.   procedure DefaultPrefs;
  507.  
  508.   begin
  509.     PDat:=PrefsTyp("V1.3",
  510.                    ((10,10,10),(0,0,0),(13,14,13),(3,8,5)),
  511.                    1,4,4);
  512.     UpPr:=PDat;
  513.     SetColors;
  514.   end;
  515.  
  516. {------------------------------------------------------------------------}
  517.  
  518.   procedure Prefs;
  519.  
  520.   var PWin : ^Window;
  521.       PRast: ^RastPort;
  522.       PMsg : ^IntuiMessage;
  523.       Pxy  : array[1..20] of xyTyp;
  524.       PBor : array[1..20] of Border;
  525.       PImg : Image;
  526.       PGad : array[1..20] of Gadget;
  527.       PTxt : array[1..20] of IntuiText;
  528.       PCl  : long;
  529.       PCod : word;
  530.       PAdr : ^Gadget;
  531.       PInfo: array[1..3] of PropInfo;
  532.  
  533.       OldP : PrefsTyp;
  534.       ACol : cardinal;
  535.  
  536.       AktProp : cardinal;
  537.  
  538.       ex                       : boolean;
  539.       cnt1,cnt2,cnt3,cnt4,cnt5 : integer;
  540.  
  541.   {······································································}
  542.  
  543.     procedure OutText(x,y:integer;s:str);
  544.  
  545.     var hs1,hs2 : IntuiText;
  546.  
  547.     begin
  548.       hs1:=IntuiText(1,0,1,0,0,Nil,"                        ",^hs2);
  549.       hs2:=IntuiText(1,0,1,0,0,Nil,s,Nil);
  550.       PrintIText(PRast,^hs1,x,y);
  551.     end;
  552.  
  553.   {······································································}
  554.  
  555.     procedure ShowOne(x:cardinal);
  556.  
  557.     var h    : string;
  558.         h2,h3: IntuiText;
  559.  
  560.     begin
  561.         PInfo[x+1].HorizPot:=PDat.Colors[ACol,x]*4096;
  562.         PGad[x+9].NextGadget:=Nil;
  563.         RefreshGadgets(^PGad[x+9],PWin,Nil);
  564.         PGad[x+9].NextGadget:=^PGad[x+10];
  565.         h:=intstr(trunc(PInfo[x+1].HorizPot/4096));
  566.         h2:=IntuiText(1,0,1,250,120+x*16,Nil,"  ",^h3);
  567.         h3:=Intuitext(1,0,1,250,120+x*16,Nil,h,Nil);
  568.         PrintIText(PRast,^h2,0,0);
  569.      end;
  570.  
  571.   {······································································}
  572.  
  573.     procedure ShowColor(ACol:cardinal);
  574.  
  575.     begin
  576.       SetAPen(PRast,ACol);
  577.       RectFill(PRast,165,91,272,106);
  578.       for i:=0 to 2 do
  579.         ShowOne(i);
  580.     end;
  581.  
  582.   {······································································}
  583.  
  584.     procedure ConvertColor(x:cardinal);
  585.  
  586.     begin
  587.       PDat.Colors[ACol,x]:=trunc(PInfo[x+1].HorizPot/4096);
  588.       SetColors;
  589.       ShowOne(x);
  590.     end;
  591.  
  592.   {······································································}
  593.  
  594.     procedure IncColor(n:cardinal);
  595.  
  596.     begin
  597.       if PDat.Colors[ACol,n]=15 then
  598.         PDat.Colors[ACol,n]:=0
  599.       else
  600.         inc(PDat.Colors[ACol,n]);
  601.       SetColors;
  602.       ShowOne(n);
  603.     end;
  604.  
  605.   {······································································}
  606.  
  607.     procedure FlipQual;
  608.  
  609.     type QualText = array[1..3] of str;
  610.  
  611.     var QText : QualText;
  612.  
  613.     begin
  614.       QText:=QualText("Near Letter Quality",
  615.                       "NLQ & Doublestrike",
  616.                       "Draft Quality");
  617.       if cnt1=3 then
  618.         cnt1:=1
  619.       else
  620.         inc(cnt1);
  621.       PDat.Qual:=cnt1;
  622.       OutText(368,88,QText[cnt1]);
  623.     end;
  624.  
  625.   {······································································}
  626.  
  627.     procedure FlipRequest;
  628.  
  629.     type RequestText = array[1..8] of str;
  630.  
  631.     var RText : RequestText;
  632.  
  633.     begin
  634.       RText:=RequestText("Ende",
  635.                          "Ende & Neu",
  636.                          "Ende & Druck",
  637.                          "Ende & Neu & Druck",
  638.                          "Neu",
  639.                          "Neu & Druck",
  640.                          "Druck",
  641.                          "Keine Abfrage");
  642.       if cnt2=8 then
  643.         cnt2:=1
  644.       else
  645.         inc(cnt2);
  646.       PDat.Request:=cnt2;
  647.       OutText(368,120,RText[cnt2]);
  648.     end;
  649.  
  650.   {······································································}
  651.  
  652.     procedure FlipNew;
  653.  
  654.     type NewText = array[1..8] of str;
  655.  
  656.     var NText : NewText;
  657.  
  658.     begin
  659.       NText:=NewText("Alles",
  660.                      "Empfängeranschrift",
  661.                      "Absenderanschrift",
  662.                      "Empfänger & Info",
  663.                      "Absender & Info",
  664.                      "Empfänger & Absender",
  665.                      "Info",
  666.                      "Empfänger & Abs. & Info");
  667.       if cnt3=8 then
  668.         cnt3:=1
  669.       else
  670.         inc(cnt3);
  671.       PDat.NewForm:=cnt3;
  672.       OutText(368,152,NText[cnt3]);
  673.     end;
  674.  
  675.   {······································································}
  676.  
  677.     procedure FlipColor;
  678.  
  679.     type ColorText = array[1..6] of str;
  680.          ColorTyp  = array[1..6,0..3,0..2] of cardinal;
  681.  
  682.     var CText : ColorText;
  683.         Color : ColorTyp;
  684.         j     : cardinal;
  685.  
  686.     begin
  687.       CText:=ColorText("Dreamer`s Special",
  688.                        "Cool WB2.0 Style",
  689.                        "Freaky WB1.3 Style",
  690.                        "Shocking !!!",
  691.                        "Wooden",
  692.                        "Grau in grau");
  693.       Color:=ColorTyp(((10,10,10),(0,0,0),(13,14,13),(3,8,5)),
  694.                       ((10,10,10),(0,0,0),(14,14,14),(6,8,11)),
  695.                       ((0,5,10),(15,15,15),(0,0,2),(15,8,0)),
  696.                       ((15,0,0),(0,15,0),(0,0,15),(15,15,0)),
  697.                       ((10,7,0),(6,3,0),(15,12,0),(12,9,0)),
  698.                       ((10,10,10),(2,2,2),(13,13,13),(6,6,6)));
  699.  
  700.       if cnt4=6 then
  701.         cnt4:=1
  702.       else
  703.         inc(cnt4);
  704.       if NotFirstCall then begin
  705.         for i:=0 to 3 do
  706.           for j:=0 to 2 do
  707.             PDat.Colors[i,j]:=Color[cnt4,i,j];
  708.         SetColors;
  709.         ShowColor(ACol);
  710.       end;
  711.       OutText(68,182,CText[cnt4]);
  712.     end;
  713.  
  714.   {······································································}
  715.  
  716.     procedure SavePrefs;
  717.  
  718.     var f : file of PrefsTyp;
  719.  
  720.     begin
  721.       Close_Window(PWin);
  722.       StatusText("Speichere Einstellungen ab...");
  723.       assign(f,"UniPrint.prf");
  724.       reset(f);
  725.       if ioresult>0 then begin
  726.         StatusText("Abspeichern klappte nicht, File nicht zu öffnen");
  727.         delay(2*50);
  728.         StatusText("");
  729.         exit;
  730.       end;
  731.       PDat.Version:="V1.3";
  732.       writeln(f,PDat);
  733.       if ioresult>0 then
  734.         StatusText("Schreibfehler, Einstellungen nicht gespeichert")
  735.       else
  736.         StatusText("Einstellungen gespeichert, alles OK...");
  737.       close(f);
  738.       delay(2*50);
  739.       StatusText("");
  740.     end;
  741.  
  742.   {······································································}
  743.  
  744.     procedure DefaultPrefs2;
  745.  
  746.     begin
  747.       DefaultPrefs;
  748.       ACol:=0;
  749.       ShowColor(ACol);
  750.       cnt1:=PDat.Qual;
  751.       dec(cnt1);
  752.       FlipQual;
  753.       cnt2:=PDat.Request;
  754.       dec(cnt2);
  755.       FlipRequest;
  756.       cnt3:=PDat.NewForm;
  757.       dec(cnt3);
  758.       FlipNew;
  759.       ACol:=0;
  760.       cnt4:=0;
  761.       NotFirstCall:=false;
  762.       FlipColor;
  763.       cnt5:=0;
  764.     end;
  765.  
  766.   {······································································}
  767.  
  768.   begin
  769.  
  770.     PDat:=UpPr;
  771.     OldP:=UpPr;
  772.  
  773.     PWin:=Open_Window(15,6,610,237,1,GADGETUP+GADGETDOWN+RAWKEY+MOUSEMOVE,
  774.                       BORDERLESS+ACTIVATE+RMBTRAP,Nil,Scr,610,237,610,237);
  775.     if PWin=Nil then begin
  776.       StatusText("Konnte Window nicht öffnen, Sorry Boss!!");
  777.       delay(2*50);
  778.       StatusText("");
  779.       exit;
  780.     end;
  781.  
  782.     PRast:=PWin^.RPort;
  783.  
  784.     CreateBoolXYData(300,20,Pxy[1],Pxy[2]);
  785.     PBor[1]:=Border(0,0,1,0,0,6,^Pxy[1],^PBor[2]);
  786.     PBor[2]:=Border(0,0,2,0,0,6,^Pxy[2],Nil);
  787.     DrawBorder(PRast,^PBor[1],160,11);
  788.  
  789.     CreateBoolXYData(120,20,Pxy[3],Pxy[4]);
  790.     PBor[3]:=Border(0,0,1,0,0,6,^Pxy[3],^PBor[4]);
  791.     PBor[4]:=Border(0,0,2,0,0,6,^Pxy[4],Nil);
  792.     PTxt[1]:=IntuiText(1,0,0,32,6,Nil,"Default",Nil);
  793.     PTxt[2]:=IntuiText(1,0,0,36,6,Nil,"Nutzen",Nil);
  794.     PTxt[3]:=IntuiText(1,0,0,24,6,Nil,"Speichern",Nil);
  795.     PTxt[4]:=IntuiText(1,0,0,24,6,Nil,"Abbrechen",Nil);
  796.  
  797.     for i:=1 to 4 do
  798.       PGad[i]:=Gadget(^PGad[i+1],20+(i-1)*150,210,120,20,GADGHCOMP,RELVERIFY,
  799.                       BOOLGADGET,^PBor[3],Nil,^PTxt[i],0,Nil,i,0);
  800.  
  801.     SetAPen(PRast,1);
  802.     Move(PRast,50,225);
  803.     Draw(PRast,58,225);
  804.     Move(PRast,204,225);
  805.     Draw(PRast,212,225);
  806.     Move(PRast,342,225);
  807.     Draw(PRast,350,225);
  808.     Move(PRast,492,225);
  809.     Draw(PRast,500,225);
  810.  
  811.  
  812.     CreateBoolXYData(270,150,Pxy[5],Pxy[6]);
  813.     PBor[5]:=Border(0,0,1,0,0,6,^Pxy[5],^PBor[6]);
  814.     PBor[6]:=Border(0,0,2,0,0,6,^Pxy[6],Nil);
  815.     DrawBorder(PRast,^PBor[5],20,45);
  816.     DrawBorder(PRast,^PBor[5],320,45);
  817.  
  818.     CreateBoolXYData(120,36,Pxy[7],Pxy[8]);
  819.     PBor[7]:=Border(0,0,1,0,0,6,^Pxy[7],^PBor[8]);
  820.     PBor[8]:=Border(0,0,2,0,0,6,^Pxy[8],Nil);
  821.     PTxt[5]:=IntuiText(1,0,0,76,5,Nil,"Akt. Farbe:",Nil);
  822.  
  823.     PGad[5]:=Gadget(^PGad[6],32,70,60,18,GADGHNONE,RELVERIFY,
  824.                     BOOLGADGET,^PBor[7],Nil,Nil,0,Nil,5,0);
  825.     PGad[6]:=Gadget(^PGad[7],93,70,60,18,GADGHNONE,RELVERIFY,
  826.                     BOOLGADGET,Nil,Nil,^PTxt[5],0,Nil,6,0);
  827.     PGad[7]:=Gadget(^PGad[8],32,89,60,18,GADGHNONE,RELVERIFY,
  828.                     BOOLGADGET,Nil,Nil,Nil,0,Nil,7,0);
  829.     PGad[8]:=Gadget(^PGad[9],93,89,60,18,GADGHNONE,RELVERIFY,
  830.                     BOOLGADGET,Nil,Nil,Nil,0,Nil,8,0);
  831.  
  832.     Move(PRast,207,83);
  833.     Draw(PRast,215,83);
  834.  
  835.     SetAPen(PRast,2);
  836.     RectFill(PRast,32,89,92,106);
  837.     SetAPen(PRast,3);
  838.     RectFill(PRast,93,89,152,106);
  839.     SetAPen(PRast,1);
  840.     RectFill(PRast,93,70,152,88);
  841.  
  842.     CreateBoolXYData(107,15,Pxy[13],Pxy[14]);
  843.     PBor[13]:=Border(0,0,1,0,0,6,^Pxy[13],^PBor[14]);
  844.     PBor[14]:=Border(0,0,2,0,0,6,^Pxy[14],Nil);
  845.     DrawBorder(PRast,^PBor[13],165,91);
  846.  
  847.     CreateBoolXYData(180,10,Pxy[9],Pxy[10]);
  848.     CreateBoolXYData(31,10,Pxy[11],Pxy[12]);
  849.     PBor[9]:=Border(0,0,1,0,0,6,^Pxy[9],^PBor[10]);
  850.     PBor[10]:=Border(0,0,2,0,0,6,^Pxy[10],Nil);
  851.     PBor[11]:=Border(0,0,1,0,0,6,^Pxy[11],^PBor[12]);
  852.     PBor[12]:=Border(0,0,2,0,0,6,^Pxy[12],Nil);
  853.     for i:=6 to 8 do
  854.       PTxt[i]:=IntuiText(1,0,0,-16,1,Nil,"R",Nil);
  855.     PTxt[7].IText:="G";
  856.     PTxt[8].IText:="B";
  857.     PImg:=Image(0,0,0,0,0,Nil,0,0,Nil);
  858.  
  859.     for i:=9 to 11 do begin
  860.       PInfo[i-8]:=PropInfo(AUTOKNOB+FREEHORIZ+PROPBORDERLESS,
  861.                            PDat.Colors[0,i-9]*4096,0,
  862.                            round(MAXBODY/16),MAXBODY,0,0,0,0,0,0);
  863.       PGad[i]:=Gadget(^PGad[i+1],52,118+(i-9)*16,180,10,GADGHNONE,
  864.                       FOLLOWMOUSE+RELVERIFY+GADGIMMEDIATE,PROPGADGET,
  865.                       ^PImg,Nil,^PTxt[i-3],0,^PInfo[i-8],i,0);
  866.       DrawBorder(PRast,^PBor[9],52,118+(i-9)*16);
  867.       DrawBorder(PRast,^PBor[11],241,118+(i-9)*16);
  868.     end;
  869.  
  870.     for i:=0 to 2 do begin
  871.       Move(PRast,35,127+i*16);
  872.       Draw(PRast,43,127+i*16);
  873.     end;
  874.  
  875.     CreateBoolXYData(210,10,Pxy[13],Pxy[14]);
  876.     PBor[13]:=Border(0,0,1,0,0,6,^Pxy[13],^PBor[14]);
  877.     PBor[14]:=Border(0,0,2,0,0,6,^Pxy[14],Nil);
  878.     DrawBorder(PRast,^PBor[13],62,180);
  879.  
  880.     for i:=0 to 1 do
  881.       DrawBorder(PRast,^Bor[17],32,180);
  882.  
  883.     PTxt[9]:=IntuiText(1,0,0,5,-14,Nil,"Voreingestellte Farben:",Nil);
  884.  
  885.     PGad[12]:=Gadget(^PGad[14],32,180,20,10,GADGHNONE+GADGIMAGE,RELVERIFY,
  886.                      BOOLGADGET,^Img[1],Nil,^PTxt[9],0,Nil,12,0);
  887.  
  888.  
  889.     Move(PRast,35,174);
  890.     Draw(PRast,43,174);
  891.  
  892.   {  CreateBoolXYData(210,10,Pxy[15],Pxy[16]);
  893.     PBor[15]:=Border(0,0,1,0,0,6,^Pxy[15],^PBor[16]);
  894.     PBor[16]:=Border(0,0,2,0,0,6,^Pxy[16],Nil);  }
  895.     for i:=10 to 12 do
  896.       PTxt[i]:=IntuiText(1,0,0,5,-14,Nil,"Druckqualität:",Nil);
  897.     PTxt[11].IText:="Ja/Nein Abfrage bei:";
  898.     PTxt[12].IText:="Neu löscht:";
  899.  
  900.     for i:=14 to 16 do begin
  901.       PGad[i]:=Gadget(^PGad[i+1],332,86+(i-14)*32,20,10,GADGHNONE+GADGIMAGE,
  902.                       RELVERIFY,BOOLGADGET,^Img[1],Nil,^PTxt[i-4],0,Nil,i,0);
  903.       DrawBorder(PRast,^Bor[17],332,86+(i-14)*32);
  904.       DrawBorder(PRast,^PBor[13],362,86+(i-14)*32);
  905.     end;
  906.     PGad[16].NextGadget:=Nil;
  907.  
  908.     Move(PRast,376,81);
  909.     Draw(PRast,384,81);
  910.     Move(PRast,336,112);
  911.     Draw(PRast,343,112);
  912.     Move(PRast,368,144);
  913.     Draw(PRast,375,144);
  914.  
  915.     PTxt[13]:=IntuiText(1,0,0,211,17,Nil,"UniPrint V1.3 Preferences",^PTxt[14]);
  916.     PTxt[14]:=IntuiText(2,0,0,210,18,Nil,"UniPrint V1.3 Preferences",^PTxt[15]);
  917.     PTxt[15]:=IntuiText(1,0,0,68,53,Nil,"- Farbeinstellungen -",^PTxt[16]);
  918.     PTxt[16]:=IntuiText(2,0,0,67,54,Nil,"- Farbeinstellungen -",^PTxt[17]);
  919.     PTxt[17]:=IntuiText(1,0,0,356,53,Nil,"- Programmeinstellungen -",^PTxt[18]);
  920.     PTxt[18]:=IntuiText(2,0,0,355,54,Nil,"- Programmeinstellungen -",Nil);
  921.  
  922.     PrintIText(PRast,^PTxt[13],0,0);
  923.  
  924.     PWin^.FirstGadget:=^PGad[1];
  925.     RefreshGadgets(PWin^.FirstGadget,PWin,Nil);
  926.  
  927.     cnt1:=PDat.Qual;
  928.     dec(cnt1);
  929.     FlipQual;
  930.     cnt2:=PDat.Request;
  931.     dec(cnt2);
  932.     FlipRequest;
  933.     cnt3:=PDat.NewForm;
  934.     dec(cnt3);
  935.     FlipNew;
  936.     ACol:=0;
  937.     cnt4:=0;
  938.  
  939.     NotFirstCall:=false;
  940.     FlipColor;
  941.     cnt5:=0;
  942.  
  943.     ShowColor(ACol);
  944.  
  945.     repeat
  946.       ex:=false;
  947.       PMsg:=Wait_Port(PWin^.UserPort);
  948.       PMsg:=Get_Msg(PWin^.UserPort);
  949.       PCl:=PMsg^.Class;
  950.       PCod:=PMsg^.Code;
  951.       PAdr:=PMsg^.IAddress;
  952.       Reply_Msg(PMsg);
  953.  
  954.       case PCl of
  955.         GADGETUP   : case PAdr^.GadgetID of
  956.                        1    : DefaultPrefs2;
  957.                        2    : begin
  958.                                 UpPr:=PDat;
  959.                                 ex:=true;
  960.                               end;
  961.                        3    : begin
  962.                                 SavePrefs;
  963.                                 exit;
  964.                               end;
  965.                        4    : begin
  966.                                 ex:=true;
  967.                                 UpPr:=OldP;
  968.                                 PDat:=OldP;
  969.                                 SetColors;
  970.                               end;
  971.                        5..8 : begin
  972.                                 ACol:=PAdr^.GadgetID-5;
  973.                                 ShowColor(ACol);
  974.                               end;
  975.                        9..11: ConvertColor(PAdr^.GadgetID-9);
  976.                        12   : begin
  977.                                 NotFirstCall:=true;
  978.                                 FlipColor;
  979.                               end;
  980.                        14   : FlipQual;
  981.                        15   : FlipRequest;
  982.                        16   : FlipNew;
  983.                        otherwise
  984.                      end;
  985.         GADGETDOWN : if PAdr^.GadgetID in [9..11] then
  986.                        AktProp:=PAdr^.GadgetID-9;
  987.         MOUSEMOVE  : ConvertColor(AktProp);
  988.         RAWKEY     : case PCod of
  989.                        $22      : DefaultPrefs2;
  990.                        $36      : begin
  991.                                     UpPr:=PDat;
  992.                                     ex:=true;
  993.                                   end;
  994.                        $21      : begin
  995.                                     SavePrefs;
  996.                                     exit;
  997.                                   end;
  998.                        $20,$45  : begin
  999.                                     ex:=true;
  1000.                                     UpPr:=OldP;
  1001.                                     PDat:=OldP;
  1002.                                     SetColors;
  1003.                                   end;
  1004.                        $01..$04 : begin
  1005.                                     ACol:=PCod-1;
  1006.                                     ShowColor(ACol);
  1007.                                   end;
  1008.                        $1d..$1f : begin
  1009.                                     ACol:=PCod-$1d;
  1010.                                     ShowColor(ACol);
  1011.                                   end;
  1012.                        $2d      : begin
  1013.                                     ACol:=3;
  1014.                                     ShowColor(ACol);
  1015.                                   end;
  1016.                        $23      : begin
  1017.                                     if cnt5=3 then
  1018.                                       cnt5:=0
  1019.                                     else
  1020.                                       inc(cnt5);
  1021.                                     ACol:=cnt5;
  1022.                                     ShowColor(ACol);
  1023.                                   end;
  1024.                        $34      : begin
  1025.                                     NotFirstCall:=true;
  1026.                                     FlipColor;
  1027.                                   end;
  1028.                        $10      : FlipQual;
  1029.                        $26      : FlipRequest;
  1030.                        $28      : FlipNew;
  1031.                        $13      : IncColor(0);
  1032.                        $24      : IncColor(1);
  1033.                        $35      : IncColor(2);
  1034.                        otherwise
  1035.                      end;
  1036.         otherwise
  1037.       end;
  1038.     until ex;
  1039.  
  1040.  
  1041.     Close_Window(PWin);
  1042.   end;
  1043.  
  1044. {------------------------------------------------------------------------}
  1045.  
  1046.   procedure ShowInfo;
  1047.  
  1048.   var IWin : ^Window;
  1049.       IRast: ^RastPort;
  1050.       IMsg : ^IntuiMessage;
  1051.       Ixy  : array[1..4] of xyTyp;
  1052.       IBor : array[1..4] of Border;
  1053.       IGad : array[1..2] of Gadget;
  1054.       ITxt : array[1..15] of IntuiText;
  1055.  
  1056.       ex   : boolean;
  1057.  
  1058.   begin
  1059.  
  1060.  
  1061.  
  1062.     IWin:=Open_Window(20,12,600,180,1,GADGETUP+RAWKEY,BORDERLESS+ACTIVATE+
  1063.                       RMBTRAP,Nil,Scr,600,180,600,180);
  1064.     if IWin=Nil then begin
  1065.       StatusText("Zu wenig Speicher - Window nicht zu öffnen");
  1066.       delay(2*50);
  1067.       StatusText("");
  1068.       exit;
  1069.     end;
  1070.  
  1071.     StatusText("Check it out, Freak !!!");
  1072.  
  1073.     IRast:=IWin^.RPort;
  1074.  
  1075.     CreateBoolXYData(300,20,Ixy[1],Ixy[2]);
  1076.     IBor[1]:=Border(0,0,1,0,0,6,^Ixy[1],^IBor[2]);
  1077.     IBor[2]:=Border(0,0,2,0,0,6,^Ixy[2],Nil);
  1078.     DrawBorder(IRast,^IBor[1],160,16);
  1079.  
  1080.     ITxt[1]:=IntuiText(1,0,0,211,22,Nil,"UniPrint V1.3 Infofenster",^ITxt[2]);
  1081.     ITxt[2]:=IntuiText(2,0,0,210,23,Nil,"UniPrint V1.3 Infofenster",^ITxt[3]);
  1082.     ITxt[3]:=IntuiText(3,0,0,218,44,Nil,"© 8/1993 by Jan Stötzer",^ITxt[4]);
  1083.     ITxt[4]:=IntuiText(1,0,0,158,60,Nil,"Dieses Programm ist FREEWARE, solange:",^ITxt[5]);
  1084.     ITxt[5]:=IntuiText(1,0,0,166,68,Nil,"· damit kein Geld verdient wird und",^ITxt[6]);
  1085.     ITxt[6]:=IntuiText(1,0,0,166,76,Nil,"· nichts an Prog & Dok verändert wird.",^ITxt[14]);
  1086.     ITxt[14]:=IntuiText(1,0,0,166,84,Nil,"· nähere Infos in der Anleitung",^ITxt[7]);
  1087.     ITxt[7]:=IntuiText(1,0,0,138,100,Nil,"Für Bugreports, Hinweise u.a. schreibt an:",^ITxt[8]);
  1088.     ITxt[8]:=IntuiText(2,0,0,142,116,Nil,"Jan Stötzer, An der Hasel 195, 98527 Suhl",^ITxt[9]);
  1089.     ITxt[9]:=IntuiText(3,0,0,86,132,Nil,"Greetings fly to: PackMAN, Diesel, Sir Jinx, Doc Brown,",^ITxt[10]);
  1090.     ITxt[10]:=IntuiText(3,0,0,94,140,Nil,"Bitworm, Amiga500SL, Buster, Erik, Ricki, Andi... !!",^ITxt[11]);
  1091.     ITxt[11]:=IntuiText(1,0,0,41,159,Nil,"Have fun with it --> Dreamer/NPS",^ITxt[12]);
  1092.     ITxt[12]:=IntuiText(2,0,0,40,160,Nil,"Have fun with it --> Dreamer/NPS",Nil);
  1093.  
  1094.     PrintIText(IRast,^ITxt[1],0,0);
  1095.  
  1096.     CreateBoolXYData(80,16,Ixy[3],Ixy[4]);
  1097.     IBor[3]:=Border(0,0,1,0,0,6,^Ixy[3],^IBor[4]);
  1098.     IBor[4]:=Border(0,0,2,0,0,6,^Ixy[4],Nil);
  1099.     ITxt[13]:=IntuiText(1,0,0,32,4,Nil,"OK",Nil);
  1100.     ITxt[15]:=IntuiText(1,0,0,20,4,Nil,"Prefs",Nil);
  1101.     IGad[1]:=Gadget(^IGad[2],341,156,80,16,GADGHCOMP,RELVERIFY,BOOLGADGET,
  1102.                     ^IBor[3],Nil,^ITxt[13],0,Nil,1,0);
  1103.     IGad[2]:=Gadget(Nil,441,156,80,16,GADGHCOMP,RELVERIFY,BOOLGADGET,
  1104.                     ^IBor[3],Nil,^ITxt[15],0,Nil,2,0);
  1105.  
  1106.     IWin^.FirstGadget:=^IGad;
  1107.     RefreshGadgets(IWin^.FirstGadget,IWin,Nil);
  1108.  
  1109.     SetAPen(IRast,1);
  1110.     Move(IRast,371,169);
  1111.     Draw(IRast,379,169);
  1112.     Move(IRast,459,169);
  1113.     Draw(IRast,467,169);
  1114.  
  1115.     ex:=false;
  1116.     repeat
  1117.       IMsg:=Wait_Port(IWin^.Userport);
  1118.       IMsg:=Get_Msg(IWin^.UserPort);
  1119.       case IMsg^.Class of
  1120.         GADGETUP : begin
  1121.                      MAdr:=IMsg^.IAddress;
  1122.                      case MAdr^.GadgetID of
  1123.                        1 : ex:=true;
  1124.                        2 : Prefs;
  1125.                        otherwise
  1126.                      end;
  1127.                    end;
  1128.         RAWKEY   : case IMsg^.Code of
  1129.                      $18,$45 : ex:=true;
  1130.                      $19     : Prefs;
  1131.                      otherwise
  1132.                    end;
  1133.         otherwise
  1134.       end;
  1135.  
  1136.       Reply_Msg(IMsg);
  1137.     until ex=true;
  1138.  
  1139.     Close_Window(IWin);
  1140.  
  1141.     StatusText("");
  1142.  
  1143.   end;
  1144.  
  1145. {------------------------------------------------------------------------}
  1146.  
  1147.   procedure PrintIt;
  1148.  
  1149.   type Ziffer = array[1..7] of str;
  1150.  
  1151.   var p   : text;
  1152.       z   : array[0..9] of Ziffer;
  1153.       err : integer;
  1154.       plz : array[1..5] of integer;
  1155.       az  : integer;
  1156.       j   : integer;
  1157.  
  1158.  
  1159.   {······································································}
  1160.  
  1161.   function Fill(what:str,num:integer):string;
  1162.  
  1163.   var i,l : integer;
  1164.       s   : string;
  1165.  
  1166.   begin
  1167.     l:=length(what);
  1168.     s:=copy(what,1,num);
  1169.     if l<num then
  1170.       for i:=1 to num-l do
  1171.         s:=(s+" ");
  1172.     Fill:=s;
  1173.   end;
  1174.  
  1175.   {······································································}
  1176.  
  1177.   procedure Absender_Klein;
  1178.  
  1179.   begin
  1180.     write(p,chr(27),"[0z",chr(27),"[4w");
  1181.     writeln(p,"Abs.: ",Buf[1]);
  1182.     writeln(p,"      ",Buf[3]);
  1183.     writeln(p,"      ",Buf[4]);
  1184.   end;
  1185.  
  1186.   {······································································}
  1187.  
  1188.   procedure Absender_Mittel;
  1189.  
  1190.   begin
  1191.     write(p,chr(27),"[0z",chr(27),"[4w");
  1192.     writeln(p,"Abs.: ",Buf[1]);
  1193.     for i:=2 to 4 do
  1194.       writeln(p,"      ",Buf[i]);
  1195.     writeln(p,"      Tel.: ",Buf[5]);
  1196.   end;
  1197.  
  1198.   {······································································}
  1199.  
  1200.   procedure Absender_Gross;
  1201.  
  1202.   begin
  1203.     write(p,chr(27),"[0z",chr(27),"[2w");
  1204.     writeln(p,"Abs.: ",Buf[1]);
  1205.     for i:=2 to 4 do
  1206.       writeln(p,"      ",Buf[i]);
  1207.     writeln(p,"      Tel.: ",Buf[5]);
  1208.   end;
  1209.  
  1210.   {······································································}
  1211.  
  1212.   procedure Adresse_Klein;
  1213.  
  1214.   begin
  1215.     write(p,chr(27),"[0z",chr(27),"[2w");
  1216.     for i:=6 to 8 do
  1217.       writeln(p,"      ",Buf[i]);
  1218.     writeln(p,copy(Buf[10],1,5)," ",Buf[9]);
  1219.   end;
  1220.  
  1221.   {······································································}
  1222.  
  1223.   procedure Adresse_Mittel;
  1224.  
  1225.   begin
  1226.     write(p,chr(27),"[1z",chr(27),"[0w");
  1227.     for i:=6 to 8 do
  1228.       writeln(p,"      ",Buf[i]);
  1229.     writeln(p,copy(Buf[10],1,5)," ",Buf[9]);
  1230.   end;
  1231.  
  1232.   {······································································}
  1233.  
  1234.   procedure Adresse_Gross;
  1235.  
  1236.   begin
  1237.     write(p,chr(27),"[1z",chr(27),"[0w");
  1238.     for i:=6 to 8 do
  1239.       writeln(p,"             ",Buf[i]);
  1240.     writeln(p);
  1241.     write(p,chr(27),"[6w",copy(Buf[10],1,5)," ");
  1242.     writeln(p,chr(27),"[0w"," ",Buf[9]);
  1243.   end;
  1244.  
  1245.   {······································································}
  1246.  
  1247.   procedure Postkarte;
  1248.  
  1249.   begin
  1250.     write(p,chr(27),"[0z",chr(27),"[2w",chr(27),"[4m");
  1251.     writeln(p,"                                                           ");
  1252.     write(p,chr(27),"[0m","|                          |                   ");
  1253.     writeln(p,chr(27),"[4m","       ",chr(27),"[0m","    |");
  1254.     write(p,"| ",chr(27),"[4w","Abs.:",Fill(Buf[1],30));
  1255.     writeln(p," |",chr(27),"[3w",chr(27),"[2w","  Postkarte        |     |    |");
  1256.     for i:=2 to 4 do begin
  1257.       write(p,"| ",chr(27),"[4w","     ",Fill(Buf[i],30));
  1258.       writeln(p," |",chr(27),"[3w",chr(27),"[2w","                   |     |    |");
  1259.     end;
  1260.     write(p,"| ",chr(27),"[4w","     Tel.: ",Fill(Buf[5],24));
  1261.     writeln(p," |",chr(27),"[3w",chr(27),"[2w","                   |     |    |");
  1262.     write(p,"| ",chr(27),"[4w","                                    |");
  1263.     write(p,chr(27),"[3w",chr(27),"[2w","                   ",chr(27),"[4m","|     |");
  1264.     writeln(p,chr(27),"[0m","    |");
  1265.     for i:=1 to 10 do begin
  1266.       write(p,"| ",chr(27),"[4w","                                    |");
  1267.       writeln(p,chr(27),"[3w",chr(27),"[2w","                              |");
  1268.     end;
  1269.     for i:=6 to 8 do begin
  1270.       write(p,"| ",chr(27),"[4w","                                    |");
  1271.       writeln(p,chr(27),"[3w",chr(27),"[2w"," ",chr(27),"[4m",Fill(Buf[i],27),chr(27),"[0m","  |");
  1272.       write(p,"| ",chr(27),"[4w","                                    |");
  1273.       writeln(p,chr(27),"[3w",chr(27),"[2w","                              |");
  1274.     end;
  1275.     for i:=1 to 5 do begin
  1276.       write(p,"| ",chr(27),"[4w");
  1277.       for j:=1 to 5 do begin
  1278.         az:=plz[j];
  1279.         write(p,z[az,i]," ");
  1280.       end;
  1281.       writeln(p," |",chr(27),"[3w",chr(27),"[2w","                              |");
  1282.     end;
  1283.     write(p,"| ",chr(27),"[4w");
  1284.     for j:=1 to 5 do begin
  1285.       az:=plz[j];
  1286.       write(p,z[az,6]," ");
  1287.     end;
  1288.     writeln(p," |",chr(27),"[3w",chr(27),"[2w"," ",chr(27),"[4m",Fill(Buf[9],27),chr(27),"[0m","  |");
  1289.     write(p,"| ",chr(27),"[4w");
  1290.     for j:=1 to 5 do begin
  1291.       az:=plz[j];
  1292.       write(p,z[az,7]," ");
  1293.     end;
  1294.     writeln(p," |",chr(27),"[3w",chr(27),"[2w","                              |");
  1295.     write(p,"| ",chr(27),"[4w","                                    |");
  1296.     writeln(p,chr(27),"[3w",chr(27),"[2w","                              |",chr(27),"[4m");
  1297.     write(p,"| ",chr(27),"[4w","                                    |");
  1298.     writeln(p,chr(27),"[3w",chr(27),"[2w","                              |",chr(27),"[0m");
  1299.   end;
  1300.  
  1301.   {······································································}
  1302.  
  1303.   procedure Paketzettel;
  1304.  
  1305.   begin
  1306.     write(p,chr(27),"[2w",chr(27),"[0z",chr(27),"[4m");
  1307.     writeln(p,"                                                            ");
  1308.     writeln(p,chr(27),"[0m","|                          |                               |");
  1309.     write(p,"| ",chr(27),"[4w","Abs.:",Fill(Buf[1],30)," |");
  1310.     writeln(p,chr(27),"[3w",chr(27),"[2w","                               |");
  1311.     for i:=2 to 4 do begin
  1312.       write(p,"| ",chr(27),"[4w","     ",Fill(Buf[i],30)," |");
  1313.       writeln(p,chr(27),"[3w",chr(27),"[2w","                               |");
  1314.     end;
  1315.     write(p,"| ",chr(27),"[4w","     Tel.: ",Fill(Buf[5],24)," |");
  1316.     writeln(p,chr(27),"[3w",chr(27),"[2w","                               |");
  1317.     for i:=1 to 3 do begin
  1318.       write(p,"| ",chr(27),"[4w","                                    |");
  1319.       writeln(p,chr(27),"[3w",chr(27),"[2w","                               |");
  1320.     end;
  1321.     write(p,chr(27),"[4m","| ",chr(27),"[4w","                                    |");
  1322.     writeln(p,chr(27),"[3w",chr(27),"[2w","                               |",chr(27),"[0m");
  1323.     write(p,"| ",chr(27),"[4w",chr(27),"[4v","Kurze Mitteilungen an Empfänger:    |");
  1324.     write(p,"  Besondere Versandformen/Vorausverfügungen:");
  1325.     writeln(p,chr(27),"[0v",chr(27),"[0w","|",chr(27),"[3w",chr(27),"[2w");
  1326.     write(p,"| ",chr(27),"[4w","                                    |");
  1327.     writeln(p,chr(27),"[3w",chr(27),"[2w","                               |");
  1328.     write(p,"| ",chr(27),"[4w",Fill(Buf[11],35)," |");
  1329.     writeln(p,chr(27),"[3w",chr(27),"[2w"," ",Fill(Buf[15],29)," |");
  1330.     for i:=12 to 13 do begin
  1331.       write(p,"| ",chr(27),"[4w",Fill(Buf[i],35)," |");
  1332.       writeln(p,chr(27),"[3w",chr(27),"[2w","                               |");
  1333.     end;
  1334.     write(p,chr(27),"[4m","| ",chr(27),"[4w","                                    |");
  1335.     writeln(p,chr(27),"[3w",chr(27),"[2w","                               |",chr(27),"[0m");
  1336.     write(p,"| ",chr(27),"[4w","                                     ");
  1337.     writeln(p,chr(27),"[3w",chr(27),"[2w","                               |");
  1338.     for i:=6 to 8 do begin
  1339.       write(p,"| ",chr(27),"[4w","                                     ");
  1340.       writeln(p,chr(27),"[3w",chr(27),"[2w","  ",chr(27),"[4m",Fill(Buf[i],27),chr(27),"[0m","  |");
  1341.       write(p,"| ",chr(27),"[4w","                                     ");
  1342.       writeln(p,chr(27),"[3w",chr(27),"[2w","                               |");
  1343.     end;
  1344.     for i:=1 to 5 do begin
  1345.       write(p,"| ",chr(27),"[4w");
  1346.       for j:=1 to 5 do begin
  1347.         az:=plz[j];
  1348.         write(p,z[az,i]," ");
  1349.       end;
  1350.       writeln(p,"  ",chr(27),"[3w",chr(27),"[2w","                               |");
  1351.     end;
  1352.     write(p,"| ",chr(27),"[4w");
  1353.     for j:=1 to 5 do begin
  1354.       az:=plz[j];
  1355.       write(p,z[az,6]," ");
  1356.     end;
  1357.     writeln(p,"  ",chr(27),"[3w",chr(27),"[2w","  ",chr(27),"[4m",Fill(Buf[9],27),chr(27),"[0m","  |");
  1358.     write(p,"| ",chr(27),"[4w");
  1359.     for j:=1 to 5 do begin
  1360.       az:=plz[j];
  1361.       write(p,z[az,7]," ");
  1362.     end;
  1363.     writeln(p,"  ",chr(27),"[3w",chr(27),"[2w","                               |");
  1364.     write(p,"| ",chr(27),"[4w","                                     ");
  1365.     writeln(p,chr(27),"[3w",chr(27),"[2w","                               |",chr(27),"[4m");
  1366.     write(p,"| ",chr(27),"[4w","                                     ");
  1367.     writeln(p,chr(27),"[3w",chr(27),"[2w","                               |",chr(27),"[0m");
  1368.   end;
  1369.  
  1370.   {······································································}
  1371.  
  1372.   procedure Postkarte_Doppelt;
  1373.  
  1374.   begin
  1375.     Postkarte;
  1376.     for i:=1 to 31 do begin
  1377.       write(p,"| ",chr(27),"[4w","                                     ");
  1378.       writeln(p,chr(27),"[2w","                              |");
  1379.     end;
  1380.     write(p,chr(27),"[4m","| ",chr(27),"[4w");
  1381.     write(p,"                                     ",chr(27),"[2w");
  1382.     writeln(p,"                              |",chr(27),"[0m");
  1383.   end;
  1384.  
  1385.   {······································································}
  1386.  
  1387.   begin
  1388.  
  1389.     z[0]:=Ziffer("  *** ",
  1390.                  " *   *",
  1391.                  " *   *",
  1392.                  " *   *",
  1393.                  " *   *",
  1394.                  " *   *",
  1395.                  "  *** ");
  1396.     z[1]:=Ziffer("   *  ",
  1397.                  "  **  ",
  1398.                  " * *  ",
  1399.                  "   *  ",
  1400.                  "   *  ",
  1401.                  "   *  ",
  1402.                  "  *** ");
  1403.     z[2]:=Ziffer("  *** ",
  1404.                  " *   *",
  1405.                  "     *",
  1406.                  "    * ",
  1407.                  "   *  ",
  1408.                  "  *   ",
  1409.                  " *****");
  1410.     z[3]:=Ziffer("  *** ",
  1411.                  " *   *",
  1412.                  "     *",
  1413.                  "   ** ",
  1414.                  "     *",
  1415.                  " *   *",
  1416.                  "  *** ");
  1417.     z[4]:=Ziffer("   ** ",
  1418.                  "  * * ",
  1419.                  " *  * ",
  1420.                  " *****",
  1421.                  "    * ",
  1422.                  "    * ",
  1423.                  "    * ");
  1424.     z[5]:=Ziffer(" *****",
  1425.                  " *    ",
  1426.                  " *    ",
  1427.                  " **** ",
  1428.                  "     *",
  1429.                  " *   *",
  1430.                  "  *** ");
  1431.     z[6]:=Ziffer("  *** ",
  1432.                  " *   *",
  1433.                  " *    ",
  1434.                  " **** ",
  1435.                  " *   *",
  1436.                  " *   *",
  1437.                  "  *** ");
  1438.     z[7]:=Ziffer(" *****",
  1439.                  "     *",
  1440.                  "     *",
  1441.                  "    * ",
  1442.                  "   *  ",
  1443.                  "   *  ",
  1444.                  "   *  ");
  1445.     z[8]:=Ziffer("  *** ",
  1446.                  " *   *",
  1447.                  " *   *",
  1448.                  "  *** ",
  1449.                  " *   *",
  1450.                  " *   *",
  1451.                  "  *** ");
  1452.     z[9]:=Ziffer("  *** ",
  1453.                  " *   *",
  1454.                  " *   *",
  1455.                  "  ****",
  1456.                  "     *",
  1457.                  "     *",
  1458.                  "  *** ");
  1459.  
  1460.     for i:=1 to 5 do
  1461.       val(copy(Buf[10],i,1),plz[i],err);
  1462.  
  1463.     assign(p,"prt:");
  1464.     rewrite(p);
  1465.  
  1466.     if ioresult>0 then begin
  1467.       StatusText("Drucker nicht ansprechbar, keine Ausgabe möglich...");
  1468.       delay(2*50);
  1469.       StatusText("");
  1470.       exit;
  1471.     end;
  1472.  
  1473.     StatusText("Druckvorgang läuft ...");
  1474.  
  1475.     if FirstCall then begin
  1476.       write(p,chr(27),"c");
  1477.       writeln(p,chr(27),"[2",chr(34),"z","    ");
  1478.       writeln(p);
  1479.       close(p);
  1480.       assign(p,"prt:");
  1481.       rewrite(p);
  1482.       FirstCall:=false
  1483.     end;
  1484.  
  1485.     write(p,chr(27),"#1");
  1486.  
  1487.     if UpPr.Qual=3 then
  1488.       write(p,chr(27),"[1",chr(34),"z")
  1489.     else begin
  1490.       write(p,chr(27),"[2",chr(34),"z");
  1491.       if UpPr.Qual=2 then
  1492.         write(p,chr(27),"[4",chr(34),"z");
  1493.     end;
  1494.  
  1495.     case cnt of
  1496.       1 : Paketzettel;
  1497.       2 : Adresse_Klein;
  1498.       3 : Adresse_Mittel;
  1499.       4 : Adresse_Gross;
  1500.       5 : Absender_Klein;
  1501.       6 : Absender_Mittel;
  1502.       7 : Absender_Gross;
  1503.       8 : Postkarte;
  1504.       9 : Postkarte_Doppelt;
  1505.       otherwise
  1506.     end;
  1507.  
  1508.     StatusText("Drucken beendet");
  1509.     Delay(2*50);
  1510.     StatusText("");
  1511.  
  1512.     close(p);
  1513.  
  1514.   end;
  1515.  
  1516. {------------------------------------------------------------------------}
  1517.  
  1518.   procedure Cli;
  1519.  
  1520.   var CWin : ^Window;
  1521.       CMsg : ^IntuiMessage;
  1522.  
  1523.       ex   : boolean;
  1524.  
  1525.   begin
  1526.     CWin:=Open_Window(340,0,300,10,1,MOUSEBUTTONS,WINDOWDRAG+WINDOWDEPTH+ACTIVATE+
  1527.                       RMBTRAP,"Zurück zu UniPrint !!!",Nil,300,12,300,12);
  1528.     if CWin=Nil then
  1529.       exit;
  1530.     ScreenToBack(Scr);
  1531.  
  1532.     repeat
  1533.       ex:=false;
  1534.       CMsg:=Wait_Port(CWin^.UserPort);
  1535.       CMsg:=Get_Msg(CWin^.UserPort);
  1536.       case CMsg^.Class of
  1537.         MOUSEBUTTONS : if (CMsg^.Code and $80)=0 then
  1538.                          if (CMsg^.Code and 1)=1 then
  1539.                            ex:=true;
  1540.         otherwise
  1541.       end;
  1542.       Reply_Msg(CMsg);
  1543.     until ex;
  1544.     Close_Window(CWin);
  1545.     ScreenToFront(Scr);
  1546.   end;
  1547. {------------------------------------------------------------------------}
  1548.  
  1549.   procedure LoadPrefs;
  1550.  
  1551.   begin
  1552.     writeln("Lade UniPrint-Einstellungen");
  1553.     writeln;
  1554.     assign(f,"UniPrint.prf");
  1555.     reset(f);
  1556.     if ioresult=0 then
  1557.       readln(f,UpPr);
  1558.     if ioresult>0 then begin
  1559.       writeln("Einstellungen konnten nicht geladen werden.");
  1560.       writeln("Benutze Standarteinstellungen");
  1561.       writeln;
  1562.       write(" ---> RETURN");
  1563.       readln(x);
  1564.       DefaultPrefs;
  1565.     end else begin
  1566.       writeln("Einstellungen erfolgreich geladen");
  1567.       if UpPr.Version<>"V1.3" then begin
  1568.         writeln;
  1569.         writeln("Das sind keine UniPrintV1.3-Einstellungen !!!");
  1570.         writeln("Benutze Standarteinstellungen...");
  1571.         writeln;
  1572.         write(" ---> RETURN");
  1573.         readln(x);
  1574.         DefaultPrefs;
  1575.       end;
  1576.     end;
  1577.   end;
  1578.  
  1579. {------------------------------------------------------------------------}
  1580.  
  1581. begin
  1582.  
  1583.   OpenLib(IntBase,"intuition.library",0);
  1584.   if IntBase=Nil then
  1585.     Error("Sorry, no Intuition...");
  1586.  
  1587.   OpenLib(GfxBase,"graphics.library",0);
  1588.   if GfxBase=Nil then
  1589.     Error("Sorry, no Graphics...");
  1590.  
  1591.   if fromWB then begin
  1592.     WWin:=Open_Window(100,100,200,60,1,0,ACTIVATE,"UniPrint V1.3",Nil,
  1593.                       200,60,200,60);
  1594.     if WWin<>Nil then begin
  1595.       WCon:=OpenConsole(WWin);
  1596.       if WCon<>Nil then begin
  1597.         SetStdIO(WCon);
  1598.         LoadPrefs;
  1599.         SetStdIO(Nil);
  1600.         CloseConsole(WCon);
  1601.         Close_Window(WWin);
  1602.       end;
  1603.     end;
  1604.   end else
  1605.     LoadPrefs;
  1606.  
  1607.   Init;
  1608.  
  1609.   ex:=false;
  1610.   repeat
  1611.     Msg:=Wait_Port(Win^.UserPort);
  1612.     Msg:=Get_Msg(Win^.UserPort);
  1613.     MCl:=Msg^.Class;
  1614.     MAdr:=Msg^.IAddress;
  1615.     MCod:=Msg^.Code;
  1616.     Reply_Msg(Msg);
  1617.     case MCl of
  1618.       GADGETUP : case MAdr^.GadgetID of
  1619.                    0     : if UpPr.Request in [3,4,6,7] then begin
  1620.                              if Sure then
  1621.                                PrintIt;
  1622.                            end else PrintIt;
  1623.                    1     : ShowInfo;
  1624.                    2     : if ((UpPr.Request>3) and (UpPr.Request<7))
  1625.                               or (UpPr.Request=2) then begin
  1626.                                 if Sure then Neu;
  1627.                            end else
  1628.                              Neu;
  1629.                    3     : Prefs;
  1630.                    4     : if UpPr.Request<5 then begin
  1631.                              if Sure then
  1632.                                ex:=true;
  1633.                            end else
  1634.                              ex:=true;
  1635.                    5..16 : ok:=ActivateGadget(^Gad[MAdr^.GadgetID+1],Win,Nil);
  1636.                    17    : ok:=ActivateGadget(^Gad[5],Win,Nil);
  1637.                    20    : FlipDruck;
  1638.                    21    : FlipForm;
  1639.                    22    : Cli;
  1640.                    otherwise
  1641.                  end;
  1642.       RAWKEY   : case MCod of
  1643.                    $22     : if UpPr.Request in [3,4,6,7] then begin
  1644.                                if Sure then
  1645.                                  PrintIt;
  1646.                              end else PrintIt;
  1647.                    $35,$45 : if UpPr.Request<5 then begin
  1648.                                if Sure then
  1649.                                  ex:=true;
  1650.                              end else
  1651.                                ex:=true;
  1652.                    $36     : if ((UpPr.Request>3) and (UpPr.Request<7))
  1653.                                 or (UpPr.Request=2) then begin
  1654.                                   if Sure then Neu;
  1655.                              end else
  1656.                                Neu;
  1657.                    $17     : ShowInfo;
  1658.                    $19     : Prefs;
  1659.                    $20     : FlipDruck;
  1660.                    $34     : FlipForm;
  1661.                    $21     : ok:=ActivateGadget(^Gad[5],Win,Nil);
  1662.                    $12     : ok:=ActivateGadget(^Gad[10],Win,Nil);
  1663.                    $27     : ok:=ActivateGadget(^Gad[15],Win,Nil);
  1664.                    $33     : Cli;
  1665.                    otherwise
  1666.                  end;
  1667.       otherwise
  1668.     end;
  1669.   until ex=true;
  1670.  
  1671.   Prc^.pr_WindowPtr:=OWin;
  1672.  
  1673.   Free_Mem(Long(Dat[1]),SizeOf(ImgPlane));
  1674.  
  1675.   Close_Window(Win);
  1676.   Close_Screen(Scr);
  1677.  
  1678.   CloseLib(GfxBase);
  1679.   CloseLib(IntBase);
  1680.  
  1681. end.
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688.